package bTree.LeetCode;

import java.util.Arrays;

public class 分发饼干 {
    public int findContentChildren(int[] g, int[] s) {
        int glen=g.length,slen=s.length;
        int nums=0;
        int left=0,right=0;
        Arrays.sort(g);
        Arrays.sort(s);
        while (left<glen&&right<slen){
            if(s[right]>=g[left]){
                nums++;
                right++;
                left++;
            }else{
                right++;
            }
        }
        return nums;

    }
}